#include <iostream>
#include<iomanip>
#include<ctime>

#define N 5

using namespace std;

int main( )
{
    int a[N][N],i,j;

    srand((unsigned int)time(0));

    for(i=0;i<N;i++)
    {
        for(j=0;j<N;j++)
        {
            a[i][j]=rand()%10;
        }
    }


    int(*p)[N];

    p=a;

    for(i=0;i<N;i++)
    {
        for(j=0;j<N;j++)
        {
            cout<<*(p[i]+j)<<" ";
        }
        cout<<endl;
    }

    cin>>i;
    return 0;
}
